<template>
    <p>小明的学习评定等级为：</p>
    <p v-if="level === 'A'">优秀</p>
    <p v-else-if="level === 'B'">良好</p>
    <p v-else>差</p>
    <p>
        <button @click="level = 'A'">切换成优秀</button>
        <button @click="level = 'B'">切换成良好</button>
        <button @click="level = 'C'">切换成差</button>
    </p>
</template>
<script setup>
    import { ref } from 'vue'
    const level = ref('A')
</script>
<style>

</style>